<?php

class AppApp extends MallbaseApp
{

	function vu()
	{
		try{
			$db=&db();
			$u=empty($_REQUEST['pin'])?"":$_REQUEST['pin'];
			if(empty($u)){
				throw new Exception('');
			}

			$sql="select 1 from zys_member where user_name='".$u."'";
			$has=$db->getOne($sql);
			if($has){
				$this->pons_result(1);
				exit();
			}
			$this->pons_result(0);
		}
		catch (Exception $e){
			$this->pons_result(1);
		}
	}

	function vp()
	{
		try{
			$db=&db();
			$u=empty($_REQUEST['mobile'])?"":$_REQUEST['mobile'];
			if(empty($u)){
				throw new Exception('');
			}

			$sql="select 1 from zys_member where phone_tel='".$u."'";
			$has=$db->getOne($sql);
			if($has){
				$this->pons_result(1);
				exit();
			}
			$this->pons_result(0);
		}
		catch (Exception $e){
			$this->pons_result(1);
		}
	}

	function pons_result($m)
	{
		$this->json_header();
		$json = ecm_json_encode(array('success' => $m));
		echo $json;
	}
}

?>
